<script>
    /****************************Check*Form*Valid********************************/
    $(function(){
        $("#formcheck").validate({
            rules: {
                titre: "required",
                categorie: "required",
                description: "required"
            },
            messages: {
                titre: "Ce champ est obligatoire !",
                categorie: "Ce champ est obligatoire !",
                txtDes: "Ce champ est obligatoire !"
            }
        });
    });
</script>
<?php   
    $selected_cate = isset($news_cat)?$news_cat:1; 
    $selected_cate_setting = array
    (
        'table_name' => 'categories',
        'key_field' => 'id',
        'value_field' => 'name'
    );    
?>
<div style="margin:10px 0px 10px 0px;">
    <?php echo $error?>
    <form id="formcheck"  method="POST" action="<?php echo site_url('avis_admin/upload_picture')?>" enctype="multipart/form-data">
        <table width="100%" id="formactu" cellpadding="10px" cellspacing="0">
            <tr>
                <td><span>TITRE </span></td>
                <td><input class="medium" type="text" name="titre" ></td>
            </tr>
            <tr>
                <td><span>IMAGE </span></td>
                <td><input type="file" name="userfile" size="33" /></td>
            </tr>
            <tr>
                <td><span>CATEGORY </span></td>
                <td>
                    <?php echo form_dropdown('categorie',dropdown_data($selected_cate_setting),$selected_cate,'style="width: 310px;"');?>
                </td>
            </tr>
            <tr>
                <td><span>DESCRIPTION </span></td>
                <td>
                <?php                                                                 
                    $data = array('name' => 'txtDes',
                    'id' => 'txtDes',
                    'width' => '600',
                    'height' => '400');
                    echo form_fckeditor($data);
                ?>
                </td>
            </tr>
            <tr>
                <td>
                    <input type="submit" class="submit"  border="0" src="images/ajouter.png"  value="SUBMIT" alt="Submit">
                </td>
            </tr>
        </table>
    </form>
</div>